import { Ref, ref, WatchStopHandle } from "vue";

export class appraisalList {
    public TaskNo: string;
    public TaskName: string;
    public TaskType: number;
    public SelectStatus: boolean;
    constructor(taskNo: string = '', taskName: string = '', taskType: number = 0, selectStatus: boolean = false) {
        this.TaskNo = taskNo
        this.TaskName = taskName
        this.TaskType = taskType
        this.SelectStatus = selectStatus
    }

}

/**
 * 考核设置
 */
export default class appraisalData {
    private static instance: appraisalData = new appraisalData();
    /**
     * 考核设置
     */
    public static get Default(): appraisalData {
        return this.instance;
    }

    constructor() {
        window.addEventListener('unload', this.Dispose.bind(this));
    }

    Dispose() {
        window.removeEventListener('unload', this.Dispose);

        for (const watchStopHandle of this.watchStopHandles) {
            watchStopHandle();
        }
        // this.watchStopHandles.clear();
    }

    public AppraisalDataList: Ref<Array<any>> = ref([])

    private watchStopHandles: Array<WatchStopHandle> = [];

    public async Awake(): Promise<void> {
    }

    public async Destroy(): Promise<void> {
    }
}